import request from './request'

//登录接口
export const LoginData = (params)=> request.post('/login',params) 
// 左侧菜单权限
export const LeftMenuBarData = ()=> request.get('/menus')
//用户数据列表
export const UsersListData = (params)=> request.get('/users',{params})
// 修改用户状态
export const ChangeStatusData = (params)=> request.put(`/users/${params.id}/state/${params.mg_state}`) 
//添加新用户
export const AddNewUsersData = (params)=> request.post('/users',params) 
//修改用户信息
export const ChangeInfoData = (params)=> request.put(`/users/${params.id}`,params) 
//删除单个用户
export const DeleteUserData = (params)=> request.delete(`/users/${params.id}`) 
//所有权限列表
export const AuthorityManagementData = (params)=> request.get(`/rights/${params.type}`)
//tree树形权限列表数据
export const AuthorityTreeManagementData = (params)=> request.get(`/rights/${params.type}`)

//角色列表
export const RoleListData = ()=> request.get('/roles')
//删除角色指定权限
export const DeleteRoleData = (params)=> request.delete(`roles/${params.roleId}/rights/${params.rightId}`) 
//角色授权
export const authorityDistributionData = (params)=> request.post(`roles/${params.roleId}/rights`,params) 
//添加角色
export const addRolesData = (params)=> request.post('/roles',params) 
//删除角色
export const DeleteOneRoleData = (params)=> request.delete(`roles/${params.id}`)
//分配用户角色
export const allocationRolesData = (params)=> request.put(`users/${params.id}/role`,params) 
//商品分类数据列表
export const CategoriesListData = (params)=> request.get('/categories',{params})
//编辑提交分类
export const CompileCategoryData = (params)=> request.put(`categories/${params.id}`,params) 
//删除分类
export const DeleteCategoryData = (params)=> request.delete(`categories/${params.id}`)
//添加分类
export const addCategoryData = (params)=> request.post('/categories',params) 

